package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderSettingDao {

    //任务四
    void insertAll(List<OrderSetting> insertOrderSettingList);

    void updateAll(List<OrderSetting> updateOrderSettingList);


    /**
     * 根据日期查询
     * @param startDate
     * @param endDate
     * @return
     */
    List<OrderSetting> selectByOrderDateRange(@Param("startDate") String startDate, @Param("endDate") String endDate);

    /**
     * 根据时间查询
     * @param orderDate
     * @return
     */
    OrderSetting selcetByOrderDate(@Param("orderDate") Date orderDate);

    /**
     * 根据ID更新数字
     * @param id
     * @param number
     */
    void updateNumberById(@Param("id") Integer id, @Param("number") int number);

    /**
     * 插入数据
     * @param orderSetting
     */
    void insert(OrderSetting orderSetting);

    //
    List<OrderSetting> getOrderSettingByMonth(String year, String month);

    //任务11
    void updateReservations(OrderSetting orderSetting);


}
